<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>蓝领安装订单系统</title>
    <link href="${ctx}/static/css/base.css" rel="stylesheet">
    <link href="${ctx}/static/css/login/login.css" rel="stylesheet">
    <style type="text/css">
        .hide {
            display: none;
        }
    </style>
</head>
<body>
<div class="login-hd">
    <div class="left-bg"></div>
    <div class="right-bg"></div>
    <div class="hd-inner">
        <span class="logo"></span>
        <span class="split"></span>
        <span class="sys-name">蓝领安装工单管理系统</span>
    </div>
</div>
<div class="login-bd">
    <div class="bd-inner">
        <div class="inner-wrap">
            <div class="lg-zone">
                <div class="lg-box">
                    <div class="lg-label"><h4>用户登录</h4></div>
                    <div class="alert alert-error ${empty errorMessage ? 'hide' : ''}">
                        <i class="iconfont">&#xe62e;</i>
                        <span>${errorMessage}</span>
                    </div>
                    <form class="form0" action="${ctx}/login" method="post">
                        <div class="lg-username input-item clearfix">
                            <i class="iconfont">&#xe60d;</i>
                            <input type="text" name="username" placeholder="账号">
                        </div>
                        <div class="lg-password input-item clearfix">
                            <i class="iconfont">&#xe634;</i>
                            <input type="password" name="password" placeholder="请输入密码">
                        </div>
                        <div class="tips clearfix">
                            <label><input name="remenberMe" type="checkbox" value="true">记住用户名</label>
                        </div>
                        <div class="enter" style="padding-left: 115px">
                            <a href="javascript:;" class="supplier">登录</a>
                        </div>
                    </form>
                </div>
            </div>
            <div class="lg-poster"></div>
        </div>
    </div>
</div>
<div class="login-ft">
    <div class="ft-inner">
        <div class="about-us">
            <a href="javascript:;">关于我们</a>
            <a href="javascript:;">法律声明</a>
            <a href="javascript:;">服务条款</a>
            <a href="javascript:;">联系方式</a>
        </div>
        <div class="address">地址：江苏省南京市雨花台区软件园&nbsp;邮编：210019&nbsp;&nbsp;Copyright&nbsp;©&nbsp;2015&nbsp;-&nbsp;2016&nbsp;uimaker-专注于ui设计&nbsp;版权所有</div>
        <div class="other-info">建议使用IE8及以上版本浏览器&nbsp;苏ICP备&nbsp;09003078号&nbsp;E-mail：admin@uimaker.com</div>
    </div>
</div>
</body>
<script type="text/javascript" src="${ctx}/static/js/jquery.js"></script>
<script type="text/javascript">
    $(function () {
        $('.supplier').on('click', function() {
        	// 对表单数据进行校验
            var $username = $('[name="username"]');
            var $password = $('[name="password"]');
            var $alert_error = $('.alert-error');
            if ($.trim($username.val()) === '') {
                $alert_error.find('span').html('请输入用户名');
                $alert_error.show();
                return;
            }
            if ($.trim($password.val()) === '') {
                $alert_error.find('span').html('请输入密码');
                $alert_error.show();
                return;
            }
            $alert_error.hide();
            $('.form0').submit();
        });
        
        $(document).on('keyup', function (event) {
            if (event.keyCode === 13) {
            	$('.supplier').click();
            }
        });
    });
</script>
</html>
